1. Field of the Invention
The present invention relates to a technique of generating an image in a virtual space in accordance with a ray tracing method.
2. Description of the Related Art
In recent years, a mixed reality technique in which a computer graphics (CG) image is superposed on a photographed scenery image serving as a background so that a composite image is generated and a person who views the composite image has a feeling that a virtual object is actually there has been proposed.
In addition, a system which is constituted by combining the mixed reality technique and a ray-tracing technique has been proposed (refer to “Interactive Mixed Reality Rendering in a Distributed Ray Tracing Framework”, Andreas Pomi, and Philipp Slusallek, and “IEEE and ACM International Symposium on Mixed and Augmented Reality” (ISMAR) 2004, Student Colloquium, Arlington, USA, Nov. 2-5, 2004). In rendering systems disclosed in these articles, a virtual object is rendered on a photographed image obtained as a video image so as to be superposed on the photographed image by means of the ray tracing technique whereby a mixed reality image is generated. In an example of rendering using this system, an image including an image of a ball which is a virtual object, which is a CG image, and which makes a shadow on a floor which is a real object is generated. To realize such an image, a virtual object representing the floor which is the real object is defined. Then, an image serving as the shadow cast on the virtual object corresponding to the floor is generated, and is combined with an image corresponding to the floor which is the real object.
Furthermore, a method for arranging a virtual object representing a real object in a mixed reality space in accordance with a result of sensing of a position and a posture of the real object and generating an image which shows a correct relationship between a depth of the virtual object and a depth of the real object has been proposed (refer to Japanese Patent Laid-Open No. 2005-293142).
In general, a person recognizes the positional relationship between objects in accordance with visual information such as a shadow and a reflection image. Therefore, also in a case of a mixed reality space, a shadow and a reflection should be correctly shown so that the person can correctly recognize a positional relationship between objects in the mixed reality space. In this case, not only a shadow and a reflection of a virtual object cast on another virtual object but also a shadow and a reflection of a real object cast on a virtual object should be correctly shown.
In the foregoing articles, a shadow of the virtual object cast on the virtual object (shown as a transparent object) representing the floor which is the real object is rendered. Here, it is assumed that two virtual objects represent real objects and one of them makes a shadow on the other. In this case, since an image of the shadow is shown in a photographed image of a real space, it is not necessary to generate an image corresponding to the shadow when the virtual objects are rendered. However, since such a case is not considered in the foregoing articles, an unnecessary image of a shadow is generated in a photographed image having a shadow. This problem may occur when a self-shadow is generated in a virtual object representing a real object. Furthermore, there arises another problem in the foregoing articles in that a reflection may not be correctly shown similarly to the case of the shadow.
In addition, in the technique in the related art, even if a position, a posture, and a shape of a real object represented by an image included in a photographed image is different from those of a virtual object corresponding to the real object, processing of generating an MR (Mixed Reality) image is performed without taking such difference into consideration. Therefore, a contradictory MR (mixed reality) image may be generated.